<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<title>材料采购总经理审核</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../res/css/layui.css" media="all">
<link rel="stylesheet" href="../../res/css/cst/snproduction.css"
	media="all">
<script type="text/javascript" src="../../res/js/jquery-1.11.2.min.js"></script>
</head>
<body>
	<from class="layui-form">
	<div class="demoTable" style="margin-left: 20px; margin-top: 10px;">
		审核状态:

		<div class="layui-inline">
			<select lay-filter="aihao" id="auStateSelect"
				style="width: 100px; border: 1px solid red;">
				<option value="">====请选择====</option>
				<option value="0">等待审核</option>
				<option value="1">财务已审核等待总经理审核</option>
				<option value="2">已审核</option>
			</select>
		</div>


		截止时间：
		<div class="layui-inline">
			<input class="layui-input" style="height: 32px;" name="id" id="date"
				placeholder="yyyy-MM-dd" autocomplete="off">
		</div>
		-
		<div class="layui-inline">
			<input class="layui-input" name="id" id="time" style="height: 32px;"
				placeholder="yyyy-MM-dd" autocomplete="off">
		</div>

		<button class="layui-btn layui-btn-sm" data-type="reload"
			id="selectButton">搜索</button>

	</div>
	</from>
	<table class="layui-table"
		lay-data="{ url:'../../audit/chaseAuditSumAll.action', page:true, id:'idTest'}"
		lay-filter="demo">
		<thead>
			<tr>
				<th lay-data="{type:'checkbox', fixed: 'left'}"></th>
				<th lay-data="{field:'all_id',align:'center',width:'300'}">材料采购业务编号</th>
				<th lay-data="{field:'optime', align:'center',width:'260'}">操作时间</th>
				<th lay-data="{field:'pur_money', align:'center',width:'180'}">采购总金额(元)</th>
				<th lay-data="{field:'pur_count', align:'center',width:'180'}">采购总数量(个)</th>
				<th
					lay-data="{field:'au_state', align:'center',width:'260',templet:'#auState'}">审核状态</th>
				<th
					lay-data="{fixed: 'right',fixed: 'right',width:'300', align:'center', toolbar: '#barDemo'}">操作</th>
			</tr>
		</thead>
	</table>
	<script type="text/javascript" id="isva">
{{# if(d.isva == 0) { }}
<div>否</div>
{{# }else if(d.isva == 1) { }}
<div>是</div>
{{# }}}
</script>
	<script type="text/javascript" id="auState">
	{{#  if(d.au_state == 1) { }}
	<div>财务已审核等待总经理审核</div>
	{{# }else if(d.au_state == 2) { }}
	<div>已审核</div>
	{{# }else if(d.au_state == 4) { }}
	<div>总部审核未通过</div>
	{{# }}}
</script>
	<script type="text/html" id="barDemo">
     <button class="layui-btn layui-btn-xs" lay-event="detailPro">查看采购详情</button>
	 <button class="layui-btn layui-btn-xs" lay-event="detailAudit">查看审核详情</button>

{{# if(d.au_state == 1) { }}
<button class="layui-btn layui-btn-warm layui-btn-xs" lay-event="edit">审核</button>
{{# }else if(d.au_state == 2) { }}
<button class="layui-btn layui-btn-warm layui-btn-xs layui-btn-disabled">审核通过</button>
{{# }else if(d.au_state == 4) { }}
<button class="layui-btn layui-btn-warm layui-btn-xs layui-btn-disabled">审核未通过</button>
{{# }}}
</script>

	<div id="purChaseDiv" style="display: none;">
		<div class="demoTable" style="margin-left: 20px; margin-top: 10px;">
			材料名称:
			<div class="layui-inline">
				<input class="layui-input" style="height: 32px;" id="comName" maxlength="7"
					placeholder="请输入材料名称:" autocomplete="off">
			</div>

			开始时间：
			<div class="layui-inline">
				<input class="layui-input" style="height: 32px;" name="id"
					id="date2" placeholder="yyyy-MM-dd" autocomplete="off">
			</div>
			-截止时间:
			<div class="layui-inline">
				<input class="layui-input" name="id" id="time2"
					style="height: 32px;" placeholder="yyyy-MM-dd" autocomplete="off">
			</div>
			<button class="layui-btn layui-btn-sm" data-type="reloadProDetail"
				id="selectButton">搜索</button>
		</div>

		<table id="myTable" class="layui-table"
			lay-data="{ url:'../../mapurDetail/findAll.action', page:true, id:'purChaseTable'}"
			lay-filter="purChaseTableDemo">
			<thead>
				<tr>
					<th lay-data="{type:'checkbox', fixed: 'left'}"></th>
					<th lay-data="{field:'deId',align:'center'}">材料采购详情编号</th>
					<th lay-data="{field:'maName',sort: true, align:'center'}">材料名称</th>
					<th lay-data="{field:'deNumber', align:'center'}">采购数量</th>
					<th lay-data="{field:'deMoney', align:'center'}">采购单价</th>
					<th lay-data="{field:'deSum', align:'center'}">采购小计</th>
					<th lay-data="{field:'optime', align:'center'}">采购小计</th>
				</tr>
			</thead>
		</table>
	</div>
	<div id="detailAuditDiv" style="display: none;">
		<table class="layui-table"
			lay-data="{ url:'../../audit/ProQuery.action', page:true, id:'auditTable'}"
			lay-filter="demo3">
			<thead>
				<tr>
					<th lay-data="{type:'checkbox', fixed: 'left'}"></th>
					<th lay-data="{field:'optime', align:'center'}">审核时间</th>
					<th lay-data="{field:'oper', align:'center'}">审核人</th>
					<th lay-data="{field:'au_state', align:'center',templet:'#auState'}">审核状态</th>
					<th lay-data="{field:'au_idea', align:'center'}">审核意见</th>
					<th lay-data="{field:'au_comment', align:'center'}">审核部门</th>
				</tr>
			</thead>
		</table>
	</div>

	<div id="auditDiv" style="display: none;">
		<form class="layui-form" id="shForm" action="" method="post">
			<input type="hidden" name="auId" id="auId"> <input type="hidden"
				name="allId" id="allId">
			<div class="layui-form-item">
				<label class="layui-form-label">审核部门</label>
				<div class="layui-input-block">
					<input type="hidden" name="auComment" value="总经理"> <input
						type="text" name="auComment" lay-verify="required" value="总经理"
						autocomplete="off" class="layui-input layui-disabled" disabled=""
						style="width: 280px;" id="bumen">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">订单名称</label>
				<div class="layui-input-block">
					<input type="text" maxlength="20" value="材料采购订单" autocomplete="off"
						class="layui-input layui-disabled" disabled=""
						style="width: 280px;">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">搜索选择框</label>
				<div class="layui-input-inline">
					<select lay-verify="required" lay-filter="isva" lay-search=""
						name="auState" id="auditPass">
						<option value="">是否通过</option>
						<option value="2">是</option>
						<option value="4">否</option>
					</select>
					<div class="layui-form-select">
						<div class="layui-select-title">
							<input type="text" placeholder="是否通过" value=""
								class="layui-input"><i class="layui-edge"></i>
						</div>
						<dl class="layui-anim layui-anim-upbit">
							<dd lay-value="" class="layui-select-tips">是否通过</dd>
							<dd lay-value="1" class="">是</dd>
							<dd lay-value="0" class="">否</dd>
						</dl>
					</div>
				</div>
			</div>
			<div class="layui-form-item layui-form-text" id="auditCause">
				<label class="layui-form-label">审核意见</label>
				<div class="layui-input-block">
					<textarea placeholder="请输入内容" maxlength="20" name="auIdea"
						id="auIdea" onblur="findAuIdea();"  class="layui-textarea" lay-verify="required"
						required=""></textarea>
						<input type="hidden" class="shYz" id="auIdeaInput"/>
				</div>
			</div>
			<div class="layui-form-item" style="margin: 0 auto; width: 350px;">
				<div class="layui-input-block">
					<input type="button" class="layui-btn layui-btn-sm"
						lay-filter="roleAdd" value="确认" id="tj"> <a
						href="javascript:exit();"
						class="layui-btn layui-btn-danger layui-btn-sm">关闭</a>
				</div>
			</div>
		</form>
	</div>
	<script src="../../res/layui.all.js" charset="utf-8"></script>
	<script type="text/javascript"
		src="../../res/js/cst/snmapurchaseauditSum.js"></script>
</body>
</html>